#include<stdio.h>
#include<string.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
int main()
{
    umask(0);
    int fd=open("log.txt",O_WRONLY|O_CREAT,0666);
    if(fd<0)
    {
        printf("open failed\n");
        return 1;
    }

    return 0;
}

   //FILE* fp=fopen("log.txt","a");
   //if(!fp)
   //{
   //    perror("fopen");
   //    return 1;
   //}
   //printf("pid=%d\n",getpid());
   //const char* str="hello Linux file\n";
   //fprintf(stdout,"%s %d\n",str,971923);
   ////fwrite(str,strlen(str),1,fp);
   //fclose(fp);
  // sleep(10000);
